package servlet.huwenyao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(value = "/SeleWareServlet2")
public class SeleWareServlet2 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //设置返回的格式
        response.setContentType("text/json;charset=UTF-8");
        //获取商品id
        String id= request.getParameter("wareId");
        if(null==id){
            //回到原页面
        }else{
            request.setAttribute("wareId",id);
            request.getRequestDispatcher("jsp/hwy/SeleWare.jsp").forward(request,response);
        }

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
